package com;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.DBManipulation;

/**
 * Servlet implementation class EditReceiptsVoucherServlet
 */
public class EditReceiptsVoucherServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public EditReceiptsVoucherServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		try
		{
		ReceiptsVoucherBean rBean=new ReceiptsVoucherBean();
		
		rBean.setReceiptsBankName(request.getParameter("rbankname"));
		rBean.setReceiptsEntryNumber(request.getParameter("rentrynumber"));
		rBean.setReceiptsCheque(request.getParameter("rchecquenumber"));
		rBean.setReceiptsDate(request.getParameter("rdate"));
		rBean.setReceiptsAccount(request.getParameter("raccount"));
		rBean.setReceiptsAmount(Double.parseDouble(request.getParameter("ramountt")));
		rBean.setReceiptsAccount2(request.getParameter("raccount2"));
		//rBean.setReceiptsAmount2(Double.parseDouble(request.getParameter("ramountt2")));
		//rBean.setReceiptsNarration(request.getParameter("rnarration"));
		//rBean.setReceiptsAccountcode1(request.getParameter("raccountcode1"));
		//rBean.setReceiptsAccountcode2(request.getParameter("raccountcode2"));
		
		DBManipulation dbc= new DBManipulation();
		dbc.updateReceiptsVoucher(rBean);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
